Skip to content

Add support for ISO 4914 UPI validation#503

Open
JonArnfred wants to merge 1 commit into
arthurdejong:masterfrom
JonArnfred:feature/iso-4914-upi
Open

Add support for ISO 4914 UPI validation#503
JonArnfred wants to merge 1 commit into
arthurdejong:masterfrom
JonArnfred:feature/iso-4914-upi

Conversation

@JonArnfred

Copy link
Copy Markdown

Summary

Add support for validating ISO 4914 Unique Product Identifiers (UPIs).

A UPI is a 12-character financial identifier for over-the-counter derivative products. The implementation validates:

  • the mandatory QZ prefix;
  • the restricted alphanumeric alphabet;
  • the 12-character length; and
  • the ISO 7064 Mod 31, 30 check character.

It also provides the standard compact(), validate(), is_valid(), and calc_check_digit() interfaces.

References

Testing

  • Added module documentation examples.
  • Added a dedicated doctest covering normalization, prefix, alphabet, length, and checksum validation.
  • Included four published valid UPIs sourced from the DSB, CME Group, and official regulatory material.
  • The new module achieves 100% test coverage.
  • Full test suite: 407 passed, 9 skipped.
  • Flake8 and strict mypy checks pass.

Publicly documented real UPI examples appear to be limited, so the test set currently contains four published examples. The official DSB archive requires registration, I can look into that if we need more examples.

  Add validation for Unique Product Identifiers, including the QZ prefix,
  restricted alphabet, and ISO 7064 Mod 31, 30 check character.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant